fname = extensie(fname, ext)
Verify extension, append extension if needed
fname | any | string, candidate filename |
ext | any | string, required file extension |
LEGACY | any | if true: Default behavior. Anything after "." is replaced extensie('donar.mat','dia') ==> donar.dia extensie('donar.mat','mat') ==> donar.mat extensie('gis.osm.shp','shp') ==> gis.shp extensie('gis.osm','shp') ==> gis.shp if false: New behavior (20171022) if proposed file has extension already (or filename containing ".") and extension is different, append extension. extensie('donar.mat','dia') ==> donar.mat.dia extensie('donar.mat','mat') ==> donar.mat extensie('gis.osm.shp','shp') ==> gis.osm.shp extensie('gis.osm','shp') ==> gis.osm.shp |
fname | any | string, filename including extension |
fname1 = extensie('donar', 'dia') fname2 = extensie('donar.dia', 'dia')
Replace or append extension AUTHOR: Nanne van der Zijpp, ModelIT